package com.ydj.demo.utils;


import com.sun.javaws.security.Resource;
import com.ydj.demo.bean.Logger;
import com.ydj.demo.bean.LoggerCreator;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesUtil {
    public static Logger getProperties() throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        Properties properties = new Properties();
        InputStream resourceAsStream = PropertiesUtil.class.getClassLoader().getResourceAsStream("logger.properties");
        properties.load(resourceAsStream);
        String strLogger = (String)properties.get("logger.classLogger");
        LoggerCreator classLogger =(LoggerCreator) Class.forName(strLogger).newInstance();
        Logger logger = classLogger.createLogger();
        return logger;
    }


}
